<template>
	<view>

		<view class="header-header">

			<view class="header-content">
				<view class="" @click="back">
					<image src="/static/back.png" v-if="backIcon" mode=""></image>
					<text>{{title}}</text>
				</view>
				<slot name="right"></slot>

			</view>
		</view>
		<view class="status_bar">

		</view>
	</view>
</template>

<script>
	export default {
		name: "uni-header",
		props: {
			title: {
				type: String,
				default: ""
			},
			backIcon: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {

			};
		},
		methods: {
			back() {
				uni.navigateBack()
			},
		}
	}
</script>

<style lang="scss" scoped>
	.status_bar {
		height:calc(112rpx +  var(--status-bar-height));
		width: 100%;
	}

	.header-header {
		width: 750rpx;
		height: 112rpx;
		padding-top: var(--status-bar-height);
		position: fixed;
		top: 0;
		left: 0;
		background: #fff;
		z-index: 99;

		.header-content {

			display: flex;
			align-items: center;
			justify-content: space-between;
			// position: absolute;
			// top: 88rpx;
			// left: 0;
			width: 100%;
			height: 112rpx;

			view {
				display: flex;
				align-items: center;
				margin-left: 30rpx;

				>image {
					width: 50rpx;
					height: 50rpx;
					display: block;
					margin-right: 15rpx;
				}

				text {
					font-weight: bold;
					font-size: 32rpx;

				}
			}


		}
	}
</style>